home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Games / NeXTGo / Source / sethand.c < prev    next >
C/C++ Source or Header  |  1993-02-08  |  2KB  |  77 lines

  1. #include "comment.header"
  2.  
  3. #define BLACKSTONE 2
  4.  
  5. extern unsigned char p[19][19];
  6. extern int MAXX, MAXY;
  7.  
  8. void sethand(int i)
  9.      /* set up handicap pieces */
  10. {
  11.   int half, q;
  12.   
  13.   half = (MAXX + 1)/2 - 1;
  14.   if (MAXX < 13)
  15.     q = 2;
  16.   else
  17.     q = 3;
  18.   
  19.   if (i > 0)
  20.     {
  21.       p[q][MAXY - q - 1] = BLACKSTONE;
  22.       if (i > 1)
  23.     {
  24.       p[MAXX - q - 1][q] = BLACKSTONE;
  25.       if (i > 2)
  26.         {
  27.           p[q][q] = BLACKSTONE;
  28.           if (i > 3)
  29.         {
  30.           p[MAXX - q - 1][MAXY - q - 1] = BLACKSTONE;
  31.           if (i == 5)
  32.             p[half][half] = BLACKSTONE;
  33.           else
  34.             if (i > 5)
  35.               {
  36.             p[q][half] = BLACKSTONE;
  37.             p[MAXX - q - 1][half] = BLACKSTONE;
  38.             if (i == 7)
  39.               p[half][half] = BLACKSTONE;
  40.             else
  41.               if (i > 7)
  42.                 {
  43.                   p[half][MAXY - q - 1] = BLACKSTONE;
  44.                   p[half][q] = BLACKSTONE;
  45.                   if (i > 8)
  46.                 p[half][half] = BLACKSTONE;
  47.                   if (i > 9)
  48.                 {p[q - 1][q - 1] = BLACKSTONE;
  49.                  if (i > 10)
  50.                    {p[MAXX - q][MAXY - q] = BLACKSTONE;
  51.                     if (i > 11)
  52.                       {p[q - 1][MAXY - q] = BLACKSTONE;
  53.                        if (i > 12)
  54.                      {p[MAXX - q][q - 1] = BLACKSTONE;
  55.                       if (i > 13)
  56.                         {p[(q + half)/2][(q + half)/2] = BLACKSTONE;
  57.                          if (i > 14)
  58.                            {p[(MAXX - q + half)/2][(MAXY - q + half)/2] = BLACKSTONE;
  59.                         if (i > 15)
  60.                           {p[(q + half)/2][(MAXY - q + half)/2] = BLACKSTONE;
  61.                            if (i > 16)
  62.                              p[(MAXX - q + half)/2][(q + half)/2] = BLACKSTONE;
  63.                          }
  64.                           }
  65.                        }
  66.                     }
  67.                      }
  68.                   }
  69.                    }
  70.                 }
  71.               }
  72.         }
  73.         }
  74.     }
  75.     }
  76. }  /* end sethand */
  77.